package com.wwtech.epp.ui.activity.work.module;

import com.wwtech.epp.data.api.HttpAPIWrapper;
import com.wwtech.epp.entity.Comment;
import com.wwtech.epp.entity.Report;
import com.wwtech.epp.ui.activity.base.ActivityScope;
import com.wwtech.epp.ui.activity.work.ProjectDetailActivity;
import com.wwtech.epp.ui.activity.work.contract.ProjectDetailContract;
import com.wwtech.epp.ui.activity.work.presenter.ProjectDetailPresenter;
import com.wwtech.epp.ui.adapter.work.CommentListAdapter;
import com.wwtech.epp.ui.adapter.work.ReportListAdapter;

import java.util.ArrayList;

import dagger.Module;
import dagger.Provides;

/**
 * @author hzp
 * @Package com.wwtech.epp.ui.activity.work
 * @Description: The moduele of ProjectDetailActivity, provide field for ProjectDetailActivity
 * @date 2017/09/15 15:02:18
 */
@Module
public class ProjectDetailModule {
    private final ProjectDetailContract.View mView;


    public ProjectDetailModule(ProjectDetailContract.View view) {
        this.mView = view;
    }

    @Provides
    @ActivityScope
    public ProjectDetailPresenter provideProjectDetailPresenter(HttpAPIWrapper httpAPIWrapper, ProjectDetailActivity mActivity) {
        return new ProjectDetailPresenter(httpAPIWrapper, mView, mActivity);
    }

    @Provides
    @ActivityScope
    public ProjectDetailActivity provideProjectDetailActivity() {
        return (ProjectDetailActivity) mView;
    }
    @Provides
    @ActivityScope
    public ReportListAdapter provideReportListAdapter() {
        return new ReportListAdapter(new ArrayList<Report>());
    }
    @Provides
    @ActivityScope
    public CommentListAdapter provideCommentListAdapter() {
        return new CommentListAdapter(new ArrayList<Comment.DataBean.ListBean>());
    }
}